package com.deyuanyun.pic.pbf.controller.dto.defect.repair;

import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.common.util.format.NumberFormat;
import com.deyuanyun.pic.pbf.domain.RepairEpoxySleeve;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;
import com.sun.org.apache.bcel.internal.classfile.Code;


/**
 * 2,钢质环氧套筒补强修复表
 *
 * @author huanglw
 * @date 2016-6-27
 *
 * History: [修改人][时间][修改描述]
 */
public class RepairEpoxySleeveDto extends RepairDto {

    /**
     * 套筒结构：侧法兰连接；侧焊缝连接
     */
    private String socketStructure;

    /**
     * 材质
     */
    private String material;

    /**
     * 套筒尺寸-壁厚（mm）
     */
    private String wallThickness;

    /**
     * 套筒尺寸-外径（mm）
     */
    private String od;

    /**
     * 修复长度（mm）
     */
    private String repairLength;

    /**
     * 环境温度（℃）
     */
    private String environmentalTemperature;

    /**
     * 管表温度（℃）
     */
    private String surfaceTemperature;

    /**
     * 灌注工艺
     */
    private String perfusionProcess;

    /**
     * 工作量
     */
    private String workload;

    /**
     * 生产厂商
     */
    private String manufacturer;

    /**
     * 是否完成该节点任务：0，没有完成；1，已经完成
     */
    private Short isCompletion;

    public RepairEpoxySleeveDto(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public Short getIsCompletion() {
        return isCompletion;
    }

    public void setIsCompletion(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public String getSocketStructure() {
        return socketStructure;
    }

    public void setSocketStructure(String socketStructure) {
        this.socketStructure = socketStructure;
    }

    public String getMaterial() {
        return material;
    }

    public void setMaterial(String material) {
        this.material = material;
    }

    public String getWallThickness() {
        return wallThickness;
    }

    public void setWallThickness(String wallThickness) {
        this.wallThickness = wallThickness;
    }

    public String getOd() {
        return od;
    }

    public void setOd(String od) {
        this.od = od;
    }

    public String getRepairLength() {
        return repairLength;
    }

    public void setRepairLength(String repairLength) {
        this.repairLength = repairLength;
    }

    public String getEnvironmentalTemperature() {
        return environmentalTemperature;
    }

    public void setEnvironmentalTemperature(String environmentalTemperature) {
        this.environmentalTemperature = environmentalTemperature;
    }

    public String getSurfaceTemperature() {
        return surfaceTemperature;
    }

    public void setSurfaceTemperature(String surfaceTemperature) {
        this.surfaceTemperature = surfaceTemperature;
    }

    public String getPerfusionProcess() {
        return perfusionProcess;
    }

    public void setPerfusionProcess(String perfusionProcess) {
        this.perfusionProcess = perfusionProcess;
    }

    public String getWorkload() {
        return workload;
    }

    public void setWorkload(String workload) {
        this.workload = workload;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public void fromDomain(RepairEpoxySleeve domain) {

        if (ObjectUtil.isEmptyAll(domain)) {
            return;
        }

        // 套筒结构：侧法兰连接；侧焊缝连接
        this.socketStructure = CodeUtil.getName(domain.getSocketStructure());
        // 材质
        this.material = CodeUtil.getName(domain.getMaterial());
        // 生产厂商
        this.manufacturer = domain.getManufacturer();
        // 套筒尺寸-壁厚（mm）
        this.wallThickness = NumberFormat.format(domain.getWallThickness());
        // 套筒尺寸-外径（mm）
        this.od = NumberFormat.format(domain.getOd());
        // 修复长度（mm）
        this.repairLength = NumberFormat.format(domain.getRepairLength());
        // 环境温度（℃）
        this.environmentalTemperature = NumberFormat.format(domain.getEnvironmentalTemperature());
        // 管表温度（℃）
        this.surfaceTemperature = NumberFormat.format(domain.getSurfaceTemperature());
        // 灌注工艺
        this.perfusionProcess = CodeUtil.getName(domain.getPerfusionProcess());
        // 工作量
        this.workload = domain.getWorkload();

        // 赋值
        super.fromDomain(domain.getId(), domain.getCreateRemark());
    }
}